<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件的基本使用</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<!--准备一个容器-->
<div id="root">
    <h2>欢迎来到{{name}}！！！</h2>
    <button v-on:click="showInfo1">点我提示信息3(no)</button>
    <button v-on:click="showInfo2(66,$event)">点我提示信息4(yes)</button>
</div>
</body>
<script type="text/javascript">
    Vue.config.productionTip=false

    const nz=new Vue({
        el:"#root",
        data:{
            name:'楠籽'
        },
        methods:{
            showInfo1(event) {
                 alert(('同学你好3'))
                // console.log(event.target.innerText)
                //console.log(this)//此处的this是nz
            },
            showInfo2(number,a) {
                console.log(number,a)
                //alert(('同学你好4'))
                // console.log(event.target.innerText)
                //console.log(this)//此处的this是nz
            }
        }
    })
</script>
</html>